<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0043)http://localhost:8080/mango/cart/list.jhtml -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>名城网上便利店</title>
<link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/css/cart.css" rel="stylesheet" type="text/css">
</head>
<body>
	<%@ include file="header.jsp" %>
	<div class="container cart">
		<div class="span24">
			<div class="step step1">
				<s:if test="pageBean.list == null || pageBean.list.size() == 0">
				<span style="color:red;">亲，您还没有下单！</span>
				</s:if>
			</div>
				<table>
					<tbody>
					<tr>
						<td colspan="5" align="center" style="font-size: 16px;">我的订单</td>
					</tr>
					<s:iterator var="order" value="pageBean.list">
					<tr>
						<th colspan="5">
						订单编号:<s:property value="#order.oid"/>&nbsp;&nbsp;&nbsp;&nbsp;订单金额：<font color="red"><s:property value="#order.total"/></font>&nbsp;&nbsp;&nbsp;&nbsp;
						订单状态：
						<s:if test="#order.state == 0">
							<a style="color:red" href="${pageContext.request.contextPath}/order_findByOid.action?oid=<s:property value="#order.oid"/>">付款</a>
						</s:if>
						<s:elseif test="#order.state == 1">
							<a>等待发货</a>
						</s:elseif>
						<s:elseif test="#order.state == 2">
							<a style="color:red" href="${pageContext.request.contextPath}/order_updateStateFor3.action?oid=<s:property value="#order.oid"/>">确认收货</a>
						</s:elseif>
						<s:elseif test="#order.state == 3">
							<a>订单结束</a>
						</s:elseif>
					</th>
					</tr>
					<tr>
						<th>图片</th>
						<th>商品</th>
						<th>价格</th>
						<th>数量</th>
						<th>小计</th>
					</tr>
						<s:iterator var="orderItem" value="#order.orderitems">
						<tr>
							<td width="60">
								<input type="hidden" name="id" value="22">
								<img src="${pageContext.request.contextPath}/<s:property value="#orderItem.product.image"/>">
							</td>
							<td>
								<a target="_blank"><s:property value="#orderItem.product.pname"/></a>
							</td>
							<td>
								￥<s:property value="#orderItem.product.price"/>
							</td>
							<td class="quantity" width="60">
								<s:property value="#orderItem.count"/>
							</td>
							<td width="140">
								<span class="subtotal">￥<s:property value="#orderItem.subtotal"/></span>
							</td>
						</tr>
						</s:iterator>
						<tr>
							<td colspan="5">&nbsp;</td>
						</tr>
					</s:iterator>
				</tbody></table>
		</div>
		<div class="pagination">
			<s:if test="pageBean.page != 1">
			<a class="firstPage" href="${pageContext.request.contextPath }/order_findByUidWithPage?page=1">&nbsp;</a>
			<a class="previousPage" href="${pageContext.request.contextPath }/order_findByUidWithPage?page=<s:property value="pageBean.page-1"/>">&nbsp;</a>
			</s:if>
				<s:iterator var="i" begin="1" end="pageBean.totalPage">
					<s:if test="pageBean.page != #i">
						<a href="${pageContext.request.contextPath }/order_findByUidWithPage?page=<s:property value="#i"/>"><s:property value="#i"/></a>
					</s:if>
					<s:else>
						<span class="currentPage"><s:property value="#i"/></span>
					</s:else>
				</s:iterator>
			<s:if test="pageBean.page != pageBean.totalPage">
			<a class="nextPage" href="${pageContext.request.contextPath }/order_findByUidWithPage?page=<s:property value="pageBean.page+1"/>">&nbsp;</a>
			<a class="lastPage" href="${pageContext.request.contextPath }/order_findByUidWithPage?page=<s:property value="pageBean.totalPage"/>">&nbsp;</a>
			</s:if>
		</div>
	</div>
<%@ include file="footer.jsp" %>
</body></html>

